import type { LoginResult, LoginParams } from '@/types/login'
import { http } from '@/utils/http'

/**
 * 小程序登录
 * @param data 请求参数
 */
export const postLoginWxMinAPI = (data: LoginParams) => {
  return http<LoginResult>({
    method: 'POST',
    url: '/login/wxMin',
    data,
  })
}

/**
 * 小程序登录_内测版
 * @param phoneNumber 模拟手机号码
 */
export const postLoginWxMinSimpleAPI = (phoneNumber: string) => {
  return http<LoginResult>({
    method: 'POST',
    url: '/login/wxMin/simple',
    data: {
      phoneNumber,
    },
  })
}

/**
 * 小程序登录_手机号验证码
 */
export const postLoginAPI = (account: string, password: string) => {
  return http<LoginResult>({
    method: 'POST',
    url: '/login',
    data: {
      account,
      password,
    },
  })
}
